package Collection.work;

import java.util.ArrayList;
import java.util.Collection;

public class CelloctionAllwork {
    public static void main(String[] args) {
        Collection<String> c1=new ArrayList<>();
        Collection<String> c2=new ArrayList<>();
        Collection<String> c3=new ArrayList<>();

        c1.add("java");
        c1.add("c++");
        c1.add("python");

        c2.add("html");
        c2.add("css");
        c2.add("javascript");

        c3.add("java");
        c3.add("css");
        c3.add("python");

        System.out.println("c1:"+c1);
        System.out.println("c2:"+c2);
        System.out.println("c3:"+c3);

        c1.addAll(c2);
        System.out.println("c1:"+c1);

        boolean b1=c1.containsAll(c2);
        boolean b2=c1.containsAll(c3);
        System.out.println("c1包含c2为"+b1);
        System.out.println("c1包含c3为"+b2);

//        c1.retainAll(c3);
//        System.out.println(c1);
        c1.removeAll(c3);
        System.out.println(c1);

    }
}
